package com.alax.interfaces.service.impl;

import java.util.List;
import com.alax.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alax.interfaces.mapper.ApiCallLogMapper;
import com.alax.interfaces.domain.ApiCallLog;
import com.alax.interfaces.service.IApiCallLogService;

/**
 * API调用记录Service业务层处理
 * 
 * @author alax
 * @date 2025-04-03
 */
@Service
public class ApiCallLogServiceImpl implements IApiCallLogService 
{
    @Autowired
    private ApiCallLogMapper apiCallLogMapper;

    /**
     * 查询API调用记录
     * 
     * @param id API调用记录主键
     * @return API调用记录
     */
    @Override
    public ApiCallLog selectApiCallLogById(Long id)
    {
        return apiCallLogMapper.selectApiCallLogById(id);
    }

    /**
     * 查询API调用记录列表
     * 
     * @param apiCallLog API调用记录
     * @return API调用记录
     */
    @Override
    public List<ApiCallLog> selectApiCallLogList(ApiCallLog apiCallLog)
    {
        return apiCallLogMapper.selectApiCallLogList(apiCallLog);
    }

    /**
     * 新增API调用记录
     * 
     * @param apiCallLog API调用记录
     * @return 结果
     */
    @Override
    public int insertApiCallLog(ApiCallLog apiCallLog)
    {
        apiCallLog.setCreateTime(DateUtils.getNowDate());
        return apiCallLogMapper.insertApiCallLog(apiCallLog);
    }

    /**
     * 修改API调用记录
     * 
     * @param apiCallLog API调用记录
     * @return 结果
     */
    @Override
    public int updateApiCallLog(ApiCallLog apiCallLog)
    {
        return apiCallLogMapper.updateApiCallLog(apiCallLog);
    }

    /**
     * 批量删除API调用记录
     * 
     * @param ids 需要删除的API调用记录主键
     * @return 结果
     */
    @Override
    public int deleteApiCallLogByIds(Long[] ids)
    {
        return apiCallLogMapper.deleteApiCallLogByIds(ids);
    }

    /**
     * 删除API调用记录信息
     * 
     * @param id API调用记录主键
     * @return 结果
     */
    @Override
    public int deleteApiCallLogById(Long id)
    {
        return apiCallLogMapper.deleteApiCallLogById(id);
    }
}
